package com.liziguo.lzgfp.server.domain;

/**
 * @Author: Liziguo
 * @Date: 2021/11/24 21:49
 */
public class Result {

    public int code;
    public String msg;
    public Object data;

    public Result() {
    }

    public Result(int code, final Object data, final String msg) {
        this.code = code;
        this.data = data;
        this.msg = msg;
    }

    public static Result success() {
        return new Result(1, null, null);
    }

    public static Result success(final Object data) {
        return new Result(1, data, null);
    }

    public static Result success(final Object data, final String msg) {
        return new Result(1, data, msg);
    }

    public static Result fail(final String msg) {
        return new Result(0, null, msg);
    }
}
